/*****************************************************************************************
   
   Copyright (c) Microsoft Corporation. All rights reserved.

   Use of this code sample is subject to the terms of the Microsoft
   Permissive License, a copy of which should always be distributed with
   this file.  You can also access a copy of this license agreement at:
   http://www.microsoft.com/resources/sharedsource/licensingbasics/permissivelicense.mspx

 ****************************************************************************************/

using System;

namespace GrooveWebServicesV12Helpers.InfoPathForms
{
    public class Template
    {
        private GrooveWebServicesV12Helpers.InfoPathForms.InfoPathForm m_InfoPathForm;
        private GrooveForms2WebService.InfoPathTemplate m_InfoPathTemplate;

        public Template(GrooveWebServicesV12Helpers.InfoPathForms.InfoPathForm i_InfoPathForm, GrooveForms2WebService.InfoPathTemplate i_InfoPathTemplate)
        {
            m_InfoPathForm = i_InfoPathForm;
            m_InfoPathTemplate = i_InfoPathTemplate;
        }

        /// <summary>
        /// The Form this template corresponds to
        /// </summary>
        public GrooveWebServicesV12Helpers.InfoPathForms.InfoPathForm Form
        {
            get
            {
                return m_InfoPathForm;
            }
        }

        /// <summary>
        /// Contains the InfoPath template, which is the InfoPath .xsn file. 
        /// </summary>
        public byte[] Contents
        {
            get
            {
                return m_InfoPathTemplate.Contents.Item;
            }
        }

        /// <summary>
        /// Contains the template PublishURL, which is the location where the template 
        /// was published before being importing into an InfoPath tool. Typically, the 
        /// PublishURL is either a web address or a file path.
        /// </summary>
        public string PublishURL
        {
            get
            {
                return m_InfoPathTemplate.PublishURL;
            }
        }

        /// <summary>
        /// Contains the InfoPath form ID, which is a unique name starting with "urn:". 
        /// </summary>
        public string URN
        {
            get
            {
                return m_InfoPathTemplate.URN;
            }
        }

        /// <summary>
        /// A string representing the InfoPath template version, such as "1.0.0.8". 
        /// </summary>
        public string Version
        {
            get
            {
                return m_InfoPathTemplate.Version;
            }
        }
    }
}
